extends Area2D

@export var clear_nums :int = 10

var line_checker_pieces_container : Array[Piece] = []

signal line_full(line_checker_pieces_container)
@onready var board: Board = $"../Board"

func _ready() -> void:
	
	board.tetromino_locked.connect(_on_lock_tetromino)
	
func _on_area_entered(area: Area2D) -> void:
	line_checker_pieces_container.append(area)
	#print("现在容器内部有" + str(current_piece))0o-plk
	

func _on_lock_tetromino() -> void:
	var current_piece = line_checker_pieces_container.size()
	print("现在容器内部有" + str(current_piece))
	if current_piece == clear_nums:
	#print("发送信号")
		Games.clear_line(line_checker_pieces_container)
